package org.elsfs.cloud.common.mybatis.ext.sql.support.order;


import lombok.RequiredArgsConstructor;
import org.elsfs.cloud.common.util.lang.NamingCase;

/**
 * 升序排序
 *

 */
@RequiredArgsConstructor
public class AscOrderItem implements OrderItem {

    /**
     * 字段名称
     */
    private final String field;

    /**
     * 构建SQL片段
     *
     * @return SQL片段
     */
    @Override
    public String buildSqlFragment() {
        return String.format(
            "%s ASC",
            NamingCase.toUnderlineCase(this.field)
        );
    }
}
